﻿using System;
using System.Data;
using System.Collections.Generic;
using SERP.DAO;
namespace SERP.Controllers{
public class SalaryRulePeopleControllerBase : Controller{
	public SalaryRulePeopleControllerBase()
		: base()
	{
	}
	private static SalaryRulePeopleDAO _Service; 
	public static SalaryRulePeopleDAO Service{
		get{
			if(_Service==null)
				_Service = new SalaryRulePeopleDAO();
			return _Service;
		}
		set{
			_Service = value;
		}
	}
    //Copy data from data row in grid to object
    public SalaryRulePeopleEntity MapDataRowToObject(DataRow row){
		SalaryRulePeopleEntity o = new SalaryRulePeopleEntity();
		 if(!row.IsNull("PersonId"))
			o.PersonId=(Int32)(row["PersonId"]);
		 if(!row.IsNull("SalaryRuleId"))
			o.SalaryRuleId=(Int32)(row["SalaryRuleId"]);
		 if(!row.IsNull("SalaryRulePeopleId"))
		    o.SalaryRulePeopleId=(Int32)(row["SalaryRulePeopleId"]);
		 return o;
    }
	//Copy data from object to data row in grid    
    public void MapObjectToDataRow(SalaryRulePeopleEntity o,DataRow row){
		row["PersonId"]=o.PersonId;
		row["SalaryRuleId"]=o.SalaryRuleId;
		row["SalaryRulePeopleId"]=o.SalaryRulePeopleId;
    }
}
}
